/*
Copyright 2014, KISSY v1.44
MIT Licensed
build time: May 22 12:27
*/
KISSY.add("event/base/utils", [], function(f) {
    function e(a) {
        if (0 > a.indexOf("."))return[a, ""];
        var b = a.match(/([^.]+)?(\..+)?$/), a = [b[1]];
        (b = b[2]) ? (b = b.split(".").sort(), a.push(b.join("."))) : a.push("");
        return a;
    }

    var d, c;
    return{
        splitAndRun: d = function(a, b) { f.isArray(a) ? f.each(a, b) : (a = f.trim(a), -1 === a.indexOf(" ") ? b(a) : f.each(a.split(/\s+/), b)); },
        normalizeParam: function(a, b, c) {
            var d = b || {}, d = "function" === typeof b ? { fn: b, context: c } : f.merge(d), b = e(a), a = b[0];
            d.groups = b[1];
            d.type = a;
            return d;
        },
        batchForType: function(a,
            b) {
            var c = f.makeArray(arguments), e = c[2 + b];
            e && "object" === typeof e ? f.each(e, function(d, e) {
                var f = [].concat(c);
                f.splice(0, 2);
                f[b] = e;
                f[b + 1] = d;
                a.apply(null, f);
            }) : d(e, function(d) {
                var e = [].concat(c);
                e.splice(0, 2);
                e[b] = d;
                a.apply(null, e);
            });
        },
        fillGroupsForEvent: function(a, b) {
            var d = e(a), f = d[1];
            f && (f = c(f), b._ksGroups = f);
            b.type = d[0];
        },
        getGroupsRe: c = function(a) { return RegExp(a.split(".").join(".*\\.") + "(?:\\.|$)"); }
    };
});
KISSY.add("event/base/object", [], function(f, e) {
    function d() {
        this.timeStamp = f.now();
        this.currentTarget = this.target = e;
    }

    var c = function() { return!1; }, a = function() { return!0; };
    d.prototype = {
        constructor: d,
        isDefaultPrevented: c,
        isPropagationStopped: c,
        isImmediatePropagationStopped: c,
        preventDefault: function() { this.isDefaultPrevented = a; },
        stopPropagation: function() { this.isPropagationStopped = a; },
        stopImmediatePropagation: function() {
            this.isImmediatePropagationStopped = a;
            this.stopPropagation();
        },
        halt: function(a) {
            a ? this.stopImmediatePropagation() :
                this.stopPropagation();
            this.preventDefault();
        }
    };
    return d;
});
KISSY.add("event/base/observer", [], function(f, e) {
    function d(c) { f.mix(this, c); }

    d.prototype = {
        constructor: d,
        equals: function(c) {
            var a = this;
            return!!f.reduce(a.keys, function(b, d) { return b && a[d] === c[d]; }, 1);
        },
        simpleNotify: function(c, a) {
            var b;
            b = this.fn.call(this.context || a.currentTarget, c, this.data);
            this.once && a.removeObserver(this);
            return b;
        },
        notifyInternal: function(c, a) {
            var b = this.simpleNotify(c, a);
            !1 === b && c.halt();
            return b;
        },
        notify: function(c, a) {
            var b = c._ksGroups;
            return b && (!this.groups || !this.groups.match(b)) ?
                e : this.notifyInternal(c, a);
        }
    };
    return d;
});
KISSY.add("event/base/observable", [], function(f) {
    function e(d) {
        this.currentTarget = null;
        f.mix(this, d);
        this.reset();
    }

    e.prototype = {
        constructor: e,
        hasObserver: function() { return!!this.observers.length; },
        reset: function() { this.observers = []; },
        removeObserver: function(d) {
            var c, a = this.observers, b = a.length;
            for (c = 0; c < b; c++)
                if (a[c] === d) {
                    a.splice(c, 1);
                    break;
                }
            this.checkMemory();
        },
        checkMemory: function() {},
        findObserver: function(d) {
            var c = this.observers, a;
            for (a = c.length - 1; 0 <= a; --a)if (d.equals(c[a]))return a;
            return-1;
        }
    };
    return e;
});
KISSY.add("event/base", ["./base/utils", "./base/object", "./base/observer", "./base/observable"], function(f, e) {
    var d = e("./base/utils"), c = e("./base/object"), a = e("./base/observer"), b = e("./base/observable");
    return{ Utils: d, Object: c, Observer: a, Observable: b };
});